package org.example;

import org.example.dao.ChickDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class ContainerDemo {
    public static void main(String[] args) {
        // 加载类路径下的配置文件
        // ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        // 加载绝对路径
        ApplicationContext applicationContext = new FileSystemXmlApplicationContext("F:\\intellij_IDEA\\workspace\\untitled\\spring-demo\\src\\main\\resources\\applicationContext.xml");
        ChickDao chickDao = (ChickDao) applicationContext.getBean("chickDao");
        chickDao.save();
    }
}
